<template>
	<div>
		<!-- <ul>
          	<li v-for="item in userList" :key='item.id'>{{item.jilu}}</li>
          </ul> -->

		<div class="box1">
			<el-card class="box-card">
				<div slot="header" class="clearfix">
					<span>{{user.name}}的消费记录</span>
				</div>
				<div v-for="o in jilu" :key="o" class="text item">
					{{ o }}
				</div>
			</el-card>
		</div>
	</div>
</template>

<script>
	import store from "../../store/modules/user.js"
	export default {
		data() {
			return {
				user: store.state.user,
				userList: store.state.userList,
				jilu:[]
			}
		},
		created() {
			var a=new Array();

			var a1=this.user.jilu;
			a=a1.split(",");
			this.jilu=a;
			
			
			const us =localStorage.getItem('username');
			if(us){
				this.getAllUser();
				this.getUser();
			}
		
		},
		methods: {
			getAllUser() {
				store.dispatch("getAlluser")
			},
			getUser() {
				store.dispatch("getUser")
			}
		},

	}
</script>

<style scoped>
	.box1 {
		margin-left: 500px;
		margin-top: 100px;
	}
	
	.text {
		font-size: 14px;
	}

	.item {
		margin-bottom: 18px;
	}

	.clearfix:before,
	.clearfix:after {
		display: table;
		content: "";
	}

	.clearfix:after {
		clear: both
	}

	.box-card {
		width: 480px;
	}
</style>
